﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>项目搜索</title>
    <link href="~/Scripts/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" />
    <script src="~/Scripts/jquery-easyui/jquery.min.js"></script>
    <script src="~/Scripts/jquery-easyui/jquery.easyui.min.js"></script>
    <script src="~/Scripts/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <link href="~/Content/themes/icon.css" rel="stylesheet" />
    <script src="~/Content/js/common.js"></script>
    <link href="~/Content/themes/table.css" rel="stylesheet" />
    </head>
    <body>
  <script>
      openTabFormat = function (subtitle, url, icon) {
          var action = '<a href="javascript:void(0)" onclick="window.parent.addTab(\'{0}\',\'{1}\')">查看</a>';
          var htmls = stringFormat(action, subtitle, url);
          // console.log(htmls);
          return htmls;
      }
      function ui_searchdata() {
         // $.show_alert("您好", "请至相关功能页面进行查询。");
          $("#ui_result_pm_dg").datagrid({
              url: '/Portal/queryMixtureProject?r=' + Math.random(),
              striped: true, rownumbers: true, pagination: true, pageSize: 5, singleSelect: true, fitColumns: false, fit: false,//自适应
              idField: 'ProjectID',
              sort: 'UpdateTime',
              order: 'desc',
              pageList: [5, 10, 30, 40, 50],
 
              queryParams: {
                  ProjectNo: $('#txtSearchNo').val(),
                  ProjectName: $('#txtSearchName').val(),
                  type: "pm",
              },
              columns: [[
                  { field: 'ProjectNo', title: '项目编码', width: 100 },
                  { field: 'ProjectName', title: '项目名称', width:250 }, {
                      width: 100, title: '操作', field: '_operate', formatter:
                  function (val, row, index) {
                      return openTabFormat('项目-' + row.ProjectName, '/Project/Index?view=pSearch&ProjectNo=' + row.ProjectNo)
                  }
                  }
              ]],

          });
          $("#ui_result_produce_dg").datagrid({
              url: '/Portal/queryMixtureProject?r=' + Math.random(),
              striped: true, rownumbers: true, pagination: true, pageSize: 5, singleSelect: true, fitColumns: false, fit: false,//自适应
              idField: 'ProjectID',
              sort: 'UpdateTime',
              order: 'desc',
              pageList: [5, 10, 30, 40, 50],
              queryParams: {
                  ProjectNo: $('#txtSearchNo').val(),
                  ProjectName: $('#txtSearchName').val(),
                  type: "produce",
              },
              columns: [[
                  { field: 'FBillNo', title: '任务单号', width: 100 },
                  { field: 'FName', title: '物料名称', width:250  }, {
                      width: 100, title: '操作', field: '_operate', formatter:
                  function (val, row, index) {
                      return openTabFormat('任务单-' + row.FName, '/Project/Projectgrid?view=pSearch&FBillNo=' + row.FBillNo)
                  }
                  }
              ]],  
          });   
      }

      $(function(){ 
          //回车搜索
          $("#protal_mix_search").find('input').on('keyup', function (event) {
              if (event.keyCode == '13') {
                  ui_searchdata();
              }
          })

      });
    
    </script>  

        @*<div  class="easyui-layout" data-options="fit:true,border:false">*@
            @*<div data-options="region:'north',split:false,border:false,collapsed:false"  style="width:300px;height:40px;">*@
        <div style="width:550px;height:40px;">
                <div id="protal_mix_search">
                    <table class="tableForm"  style="width: 99%; height: 100%; background: #F5F5F5;">
                        <tr>
                            <th>
                                编码：
                            </th>
                            <td>
                                <input name="txtSearchNo" id="txtSearchNo" class="easyui-validatebox textbox" style="width:99%;height:22px;" />
                            </td>

                            <th>
                                名称：
                            </th>
                            <td>
                                <input name="txtSearchName" id="txtSearchName" class="easyui-validatebox textbox" style="width:99%;height:22px;" />
                            </td>

                            <td>
                                <a href="javascript:void(0);" class="easyui-linkbutton" iconcls="icon-search" plain="true"
                                   onclick="ui_searchdata();">搜索</a>
                            </td>
                        </tr>
                    </table>
                </div>
            @*</div>
            <div data-options="region:'center',border:false">*@
                <table id="ui_result_pm_dg" data-options="fit:true,border:false"></table>
                <table id="ui_result_produce_dg" data-options="fit:true,border:false"></table>
            @*</div>*@
        </div>
      
    </body>
    </html>
